\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                height=4cm, width=8cm,
                title={$x[n] = \cos(0\cdot \pi n)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{1};
    \end{axis}
\end{tikzpicture}
\hspace{5pt}
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                ytick={-1,0,1}, yticklabel pos=upper,
                height=4cm, width=8cm,
                title={$x[n] = \cos(\pi n/8)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{pi*x/8})};
    \end{axis}
\end{tikzpicture}
\\
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                height=4cm, width=8cm,
                title={$x[n] = \cos(\pi n/4)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{pi*x/4})};
    \end{axis}
\end{tikzpicture}
\hspace{5pt}
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                ytick={-1,0,1}, yticklabel pos=upper,
                height=4cm, width=8cm,
                title={$x[n] = \cos(\pi n/2)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{pi*x/2})};
    \end{axis}
\end{tikzpicture}
\\
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                height=4cm, width=8cm,
                title={$x[n] = \cos(\pi n)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{pi*x})};
    \end{axis}
\end{tikzpicture}
\hspace{5pt}
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                ytick={-1,0,1}, yticklabel pos=upper,
                height=4cm, width=8cm,
                title={$x[n] = \cos(3\pi n/2)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{3*pi*x/2})};
    \end{axis}
\end{tikzpicture}
\\
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                height=4cm, width=8cm,
                title={$x[n] = \cos(7\pi n/4)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{7*pi*x/4})};
    \end{axis}
\end{tikzpicture}
\hspace{5pt}
\begin{tikzpicture}
    \begin{axis}[xlabel={$n$},
                ymin=-1.2, ymax=1.2,
                ytick={-1,0,1}, yticklabel pos=upper,
                height=4cm, width=8cm,
                title={$x[n] = \cos(15\pi n/8)$}]
        \addplot+[ycomb,domain=-16:16, samples at={-16,...,16},blue]{cos(deg{15*pi*x/8})};
    \end{axis}
\end{tikzpicture}